package com.tan00xu.controller;

import com.tan00xu.service.LoginService;
import com.tan00xu.service.TokenService;
import com.tan00xu.utils.CmdOutputInformationUtils;
import com.tan00xu.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class LogoutController {

    @Autowired
    private LoginService loginService;

    @GetMapping("/logout")
    public Result logout(@RequestHeader("Authorization") String token){
        CmdOutputInformationUtils.info("LogoutController下的logout被请求了=>退出登录");
        return loginService.logout(token);
    }
}
